module.exports.login= function(){
  wx.login().then(res => {
    console.log(res)
    wx.request({
      url: "https://kd.it-zhongyi.com/wx/code",
      method:'post',
      header:{
        "Content-Type":'application/x-www-form-urlencoded'
      },
      data:{
        code:res.code
      },
      success(info){
        console.log(info)
      }
    })
  })
}
    /*wx.request({
      url: 'https://api.weixin.qq.com/sns/jscode2session',
      data: {
        appid: "wxbcead34b05b01e45",
        js_code: res.code,
        secret: "928d92aa6ed09a54eb719df537e01124",
        grant_type: " authorization_code"
      },
      
      success(info) {
        wx.setStorage({
          key: 'openid',
          data: info.data.openid
        })
        console.log(info)
        wx.setStorage({
          key: 'session_key',
          data: info.data.session_key
        })
      }
    })*/